home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK2.toast / Development Kits / TEC 1.4 / SampleCode / DropEncoder / Headers / Preferences.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-25  |  2.1 KB  |  70 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************
  2. #
  3. #    Preferences.h
  4. #    
  5. #   This code handles loading and saving DropEncoder's preferences into the Preferences
  6. #   folder.
  7. #
  8. #    Author: Timothy Carroll
  9. #    Apple Developer Technical Support
  10. #    timc@apple.com
  11. #
  12. #    Revision: Jason Yeo
  13. #
  14. #    Modification History: 
  15. #
  16. #    2/9/97        TMC     Initial Release
  17. #
  18. #    9/12/97        JY         Updated for:
  19. #                        TEC 1.2.1 
  20. #                        Universal Interfaces 3.0
  21. #                        CodeWarrior 11 projects
  22. #
  23. #    Copyright © 1997 Apple Computer, Inc., All Rights Reserved
  24. #
  25. #
  26. #    You may incorporate this sample code into your applications without
  27. #    restriction, though the sample code has been provided "AS IS" and the
  28. #    responsibility for its operation is 100% yours.  However, what you are
  29. #    not permitted to do is to redistribute the source as "DSC Sample Code"
  30. #    after having made changes. If you're going to re-distribute the source,
  31. #    we require that you make it clear in the source that the code was
  32. #    descended from Apple Sample Code, but that you've made changes.
  33. #
  34. *************************************************************************************/
  35.  
  36. #ifndef __PREFERENCES__
  37. #define __PREFERENCES__
  38.  
  39. #pragma once
  40.  
  41. #include "TextCommon.h"
  42.  
  43. // STANDARD PREFERENCES STRUCT to be read and written to the file.  The first four bytes of
  44. // the file are the version number, so that we can compare what's on the file with the structures
  45. // we understand.
  46.  
  47. // Assuming we can deal with the version, we can read the rest of the file into the struct.
  48. // are a version number to be read in and compared.  Assuming we can read this, the remainder
  49. // of the structure
  50.  
  51. typedef struct TPreferences TPreferences;
  52.  
  53. struct TPreferences
  54. {
  55.     UInt32            version;
  56.     TextEncoding    outputEncoding;
  57.     RegionCode        locale;
  58. };
  59.  
  60.  
  61. // The App uses a global to hold the current preferences.  If we can't read the file, the prefs
  62. // are set to a default set of preferences.
  63.  
  64.  
  65.  
  66. OSStatus ReadPreferencesFile (TPreferences *prefs);
  67. OSStatus WritePreferencesFile (TPreferences *prefs);
  68. OSStatus SetDefaultPreferences (TPreferences *prefs);
  69. OSStatus EditPreferences (TPreferences *prefs);
  70. #endif //__PREFERENCES__